toolbox/src/exampleCode/audio/somePlayback Good stereo listening. someWaves.c implements functionality to generate several oscillators and waveforms. It can also change playback rate, mix, change pitch, loop audio samples and send them to the output speaker(s). This code generates 16 oscillator sound with pulse-width modulation on an Indigo--8 in the left ear and 8 in the right ear. It can change the playback rate of the audio sample with an algorithm that least impacts the CPU just adding and/or dropping samples. Also included is concise code for demonstrating looping (specify loop points and it will loop between those either forward or backward.) PLEASE NOTE THERE IS A GREAT DEAL OF DOCUMENTATION IN someWaves.c It appears the Indigo can do at least 21 oscillators (waveform of any size) with variable pitch and 26 with fixed pitch. All at 44100 samples/sec. The lower the output sampling rate, the more oscillators you get. One can vary the time duration the given program runs for (default is 10 seconds) as well as indicate a specific output filename: Usage: -help -time (seconds > 0) default: 10 <output file name> The Makefile included builds five different executables: someSawtoothWaves stereo sawtooth waves: every harmonic present with an amplitude 1/harmonic#. Compile with -DSAWTOOTH_WAVE only. someSquareWaves stereo sawtooth waves: odd harmonics present with amplitude 1/harmonic#. Square wave is a pulse wave with a 50% duty cycle. Compile with -DSQUARE_WAVE only. somePulseWaves stereo sawtooth waves: pulse wave with a short duty cycle. Compile with -DPULSE_WAVE only. somePulseWidthModulatedWaves stereo sawtooth waves: pulse waves with a modulated duty cycle. Compile with -DPULSE_WAVE and -DPULSE_WIDTH_MODULATION. someCoolWaves stereo waves: every fifth harmonic present with an amplitude 1/harmonic#. Compile with -DCOOL_WAVE only. Compiling with no flags yields no sound.
Source
Documentation
Reference